import { createSlice } from '@reduxjs/toolkit'
const numSlice = createSlice({
    name: 'count',
    initialState: {
        num: 0
    },
    reducers: {
        add(state: any) {
            state.num = state.num + 1
        },
        increment(state:any) {
            state.num = state.num - 1
        }
    }
})
export const { add, increment } = numSlice.actions
export default numSlice.reducer